//
//  RightViewController.m
//  leisure2
//
//  Created by xalo on 16/7/8.
//  Copyright © 2016年 蓝鸥科技有限公司西安分公司. All rights reserved.
//

#import "RightViewController.h"

@interface RightViewController ()

@end

@implementation RightViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //self.view.backgroundColor=[UIColor purpleColor];
    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithTitle:@"菜单" style:UIBarButtonItemStylePlain target:self action:@selector(itemAction)];
    //    UITabBarController *tabBar = [[UITabBarController alloc]init];
    //    UINavigationController *WESTVC = [[UINavigationController alloc]initWithRootViewController:[[DrawViewController alloc]initWithMenuViewController:menuVC rightViewController:menuVC.vcArray[0]]];
    //    UINavigationController *collectionVC = [[UINavigationController alloc]initWithRootViewController:[[CollectionViewController alloc]init]];
    //    UINavigationController *personVC = [[UINavigationController alloc]initWithRootViewController:[[PersonViewController alloc]init]];
    //    tabBar.viewControllers = [NSArray arrayWithObjects:WESTVC,collectionVC,personVC,nil];
}

//菜单的点击事件
- (void)itemAction{
    if (!self.isSlider) {
        //向右偏移
        [UIView animateWithDuration:0.2 animations:^{
            self.navigationController.view.frame=CGRectMake(kWidth/2, 0, kWidth, kHeight);
        }];
    }else{
        //回到原点
        [UIView animateWithDuration:0.2 animations:^{
            self.navigationController.view.frame=CGRectMake(0, 0, kWidth, kHeight);
        }];
       }
    self.isSlider=!self.isSlider;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
